/**
 * @param {number} bottom
 * @param {number} top
 * @param {number[]} special
 * @return {number}
 */
var maxConsecutive = function(bottom, top, special) {
    special = special.sort((a,b) => a-b)
    const floor = [bottom - 1, ...special, top + 1]
    const len = floor.length
    let result = 0
    for (i = 1; i < len; i++) {
        if ((floor[i]- floor[i-1] - 1) > result) {
            result = (floor[i]- floor[i-1] - 1)
        }
    }
    return result
};
const data = {
    bottom: 1, top: 29, special: [4]
}
console.log(maxConsecutive(data.bottom, data.top, data.special))